    	<script type="text/javascript" src="<?=base_url()?>js/jquery.jqprint.0.3.js"></script>
		<script>
		var $j = jQuery.noConflict();
		function print_results() {
			$j('#print_area').css({"background":"#fff"});
			$j(".hprint").css({"background":"#fff"});
			$j('#order_header').css({"display":"block"});
			$j('#print_area').jqprint();
			$j('#order_header').css({"display":"none"});
		}
		</script>
		<div class="left">
        	<h1>Store Management</h1>
            <div class="bar">

            	<div class="text">Manage Orders &raquo; View Order Details</div>
            	<div class="cr"></div>
            </div>
            <div class="box">
            	<p>
                	<input type="button" class="button rounded" value="Back to Orders List" onclick="history.go(-1)" />
                    <input onclick="print_results();" id="print_order" type="button" class="button rounded" value="Print Order" />
                </p>
            </div>            
            <hr />
            <!--
			<div id="print_area">
            <div id="order_header" class="hprint" style="background-color:#FFFFFF; height:146px; display:none;">
            	<div style="float:left; padding-left:20px; padding-top:10px;"><img src="<?=base_url()?>img/logo_signature.png" alt=""></div>
            	<div style="float:right; color:#575757; font-size:12px; padding-right:10px; padding-top:10px;">
                	<span style="font-weight:bold;">Nana Huchy</span> <br/>
                    31B Hume Street <br/>
                    Huntingdale Victoria 3166 Australia  <br/>
                    T: 1800 454 282 <br/>
                    F: +61 3 9077 3042 <br/>
                    ABN 61261315176 <br/>
                    <a href="mailto:sales@nanahuchy.com" style="text-decoration:none; color:#404040;">sales@nanahuchy.com</a><br/>
                    <a href="http://www.nanahuchy.com" target="_blank" style="text-decoration:none; color:#404040;">www.nanahuchy.com</a><br/>
                </div>                
            </div>
            </div>
            -->
            <div class="box bgw hprint" style="min-height:300px;height:auto!important">
            	<h3>Order Details</h3>
                <table cellpadding="0" cellspacing="0" border="0">
				  <tr height="25"><td width="110">Order Number</td><td><?=$order['id']?></td></tr>
                  <tr height="25"><td>Order time</td><td><?=date('H:i:s',strtotime($order['order_time']))?> on the <?=date('jS, F Y',strtotime($order['order_time']))?></td></tr>
                  <tr height="25"><td>Order status</td><td<?php if($order['status'] == 'successful') print ' class="green"'; else print ' class="error"'; ?>><?=ucwords($order['status'])?></td></tr>
                
                <?php /*if($order['status'] != 'successful') 
				{ 
					$msg = str_replace('eWAY Error:','',$order['msg']); 
					$msg = str_replace('(Test CVN Gateway)','',$msg); 
					$msg = str_replace('80,','',$msg);
					if (strlen($msg) > 80) {
						$n = strpos($msg,'.',80);
						$msg = substr($msg,0,$n);
					} */?>
                    <!--<dl class="two"><dt>Declined reason</dt><dd class="error"><?=$msg?></dd></dl>-->
                <?php //} ?>
                
                <tr>
                    <td valign="top">Purchased items</td><td valign="top">
                      <table border="0" cellpadding="0" cellspacing="">
                	<?php foreach($cart as $item) 
					{ 
					$product = $this->Product_model->identify($item['product_id']);
					//$attributes = str_replace(':',': ',$item['attributes']);
                    //$attributes = str_replace('~','. ',$attributes); ?>
                   <tr height="18"><td>$<?=$item['price']?></td><td width="10">&nbsp;</td><td><?=$item['quantity']?> x <?php if(!empty($product['title'])) echo $product['title'];?></td>
                                  <td width="10">&nbsp;</td><td><?php echo $item['attributes'];?></td>
                              </tr>
					<?
					}
				          
					?>
                      </table>
                   </td>
                  </tr>
                </table>
                <dl></dl>
                <hr />
                <dl class="two"><dt>Sub total</dt><dd>$<?=$order['subtotal']?></dd></dl>
                <dl class="two"><dt>Tax</dt><dd>$<?=$order['tax']?></dd></dl>
                <?php if($order['discount'] > 0) { 
					$coupon = $this->System_model->check_coupon_code($order['coupon_code']);
					$value = $coupon['value'];
					if ($coupon['type'] == 1) { 
						$amount = money_format('%i',floatval($value) * floatval($order['subtotal'] + $order['tax'])/100);
						$value = $value.'% (-$'.$amount.')'; 
					} else { $value = '$'.$value; }
				?>
                <dl class="two"><dt>Discount</dt><dd>-<?=$value?></dd></dl>
                <?php } 
				//only show shipping when customer is not a trade customer
				$user = $this->session->userdata('cloggedin');
				if($user['level'] != 4){
				?>
                
                <dl class="two"><dt>Shipping cost</dt><dd><dl class="three"><dt>$<?=$order['shipping_cost']?></dt><dd>Shipping method</dd><dd><?php if(!empty($shipping['id'])){ ?><a href="<?=base_url()?>admin/system/shipping/edit/<?=$shipping['id']?>"><?=$shipping['name']?></a><?php } ?></dd></dl></dd></dl>
				<?php
				}
				?>
                            
                <dl></dl><hr />
                <dl class="two"><dt>Total</dt><dd>$<?=$order['total']?></dd></dl>
               
               </dl></dl>
                <div style="clear:both"></div>
            </div>
             <div style="clear:both"></div>
            <hr />
            <div style="clear:both"></div>         
            <div class="box hprint">
            	<h3>Shipping Details</h3>
                <dl class="two"><dt>Store No</dt><dd><?=$order['storeno']?></dd></dl>
                <dl class="two"><dt>Store Name</dt><dd><?=$order['storename']?></dd></dl>
                <dl class="two"><dt>Trading Name</dt><dd><?=$order['tradingname']?></dd></dl>
                <dl class="two"><dt>Franchisee</dt><dd><?=$order['franchisee']?></dd></dl>
                <dl class="two"><dt>Address</dt><dd><?=$order['address']?></dd></dl>
                <dl class="two"><dt>Suburb</dt><dd><?=$order['suburb']?></dd></dl>
                <dl class="two"><dt>Postcode</dt><dd><?=$order['postcode']?></dd></dl>
                <dl class="two"><dt>State</dt><dd><?=$order['state']?></dd></dl>             
				
				<dl></dl>
            </div>
            <hr />
	        <!--
            <div class="box bgw">
            	<h3>Payment</h3>
                <dl class="two"><dt>Card name</dt><dd><?=$order['cardname']?></dd></dl>
                <dl class="two"><dt>Card type</dt><dd><?=$order['cardtype']?></dd></dl>
                <dl class="two"><dt>Card number</dt><dd><?=$order['cardnumber']?></dd></dl>
                <dl class="two"><dt>Expiry date</dt><dd><?php printf('%02s',$order['expmonth']); ?>/<?=$order['expyear']?></dd></dl>
                <dl class="two"><dt>CVV number</dt><dd><?=$order['cvv']?></dd></dl>
                <dl></dl>
            </div>
			-->
        </div>
        
